//********************************************************************************************************************//
//ORGANIZATION:
//AUTHOR: bpeng(bogers.peng@gmail.com)
//SUMMARY:
//********************************************************************************************************************//
#include "../Field.h"

using namespace Native::System;
using namespace Native::Compiling;

CField::CField() :
    _starting(0),
    _ending(0),
    _sequence(0)
{
}

CField::CField(const CField& that) :
    _starting(that._starting),
    _ending(that._ending),
    _sequence(that._sequence)
{
}

CField::CField(const CField&& that) :
    _starting(that._starting),
    _ending(that._ending),
    _sequence(that._sequence)
{
}

CField::~CField()
{
}

wstring CField::ToString() const
{
    wchar_t string[128] = {0};

    wsprintf(string, L"Starting Line:[%u], Ending Line:[%u]", _starting, _ending);

    return wstring(string);
}

bool CField::operator==(C_FIELD& rvalue) const
{
    return
        _starting == rvalue._starting &&
        _ending == rvalue._ending &&
        _sequence == rvalue._sequence;
}

bool CField::operator!=(C_FIELD& rvalue) const
{
    return !operator==(rvalue);
}

void CField::Clear()
{
    _starting = 0;
    _ending = 0;
    _sequence = 0;
}

CString CField::ToCode() const
{
    return EMPTY_STRING;
}

C_FIELD& CField::operator=(C_FIELD& rvalue)
{
    CObject::operator=(rvalue);

    _starting = rvalue._starting;
    _ending = rvalue._ending;
    _sequence = rvalue._sequence;

    return *this;
}
